﻿@using Aluetjen.EmailService.Domain.Models.Pipeline
@model IEnumerable<Redirection>

@{
    ViewBag.Title = "Redirections";
}

<h2>Redirections</h2>

<table>
    <tr>
        <th>
            Priority
        </th>
        <th>
            Condition
        </th>
        <th>
            Redirect To
        </th>
        <th>
            Clear CC
        </th>
        <th>
            Clear Bcc
        </th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.Priority)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Condition)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.RedirectTo)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.ClearCc)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.ClearBcc)
        </td>
    </tr>
    
}

@if (Model.Count() == 0)
{
    <tr>
        <td colspan="5">No redirections have been configured.</td>
    </tr>
}

</table>
